package p2pserver
{
	import flash.events.NetStatusEvent;
	import flash.media.Camera;
	import flash.media.H264VideoStreamSettings;
	import flash.net.NetConnection;
	import flash.net.NetStream;
	
	public class P2pNetStream extends NetStream
	{
		public static const STREAM_NAME:String = "multicast";
		
		private var camera:Camera = null;
		private var h264Settings:H264VideoStreamSettings = null;
		
		public function P2pNetStream(connection:NetConnection,
									 peerID:String="connectToFMS")
		{
			super(connection, peerID);
			
			this.addEventListener(NetStatusEvent.NET_STATUS, NetStatus);
		}

		private function NetStatus(event:NetStatusEvent):void{
			trace(event.info.code);
			switch(event.info.code){
				case "NetStream.Connect.Success":
					break;
				case "NetStream.Connect.Failed":
					break;
			}
		}
		
		public function SetVideoResource(camera:Camera):void{
			this.camera = camera;
		}
		
		public function SetSetH264Settings(h264Settings:H264VideoStreamSettings):void{
			this.h264Settings = h264Settings;
		}
	}
}